package com.wxzz.elearning.common.utils;

import com.alibaba.fastjson.JSONObject;
import com.wxzz.elearning.common.exception.ServiceException;
import com.wxzz.elearning.common.vo.ReturnVO;
import org.apache.commons.lang.StringUtils;

/**
 * @author zhangjunjie
 * @date 2021/4/26
 */
public class OpenFeignUtil {

    public static JSONObject getJSONObject(ReturnVO<String> stringReturnVO) {
        if (stringReturnVO == null || !"200".equals(stringReturnVO.getCode()) || stringReturnVO.getData() == null
                ||"null".equals(stringReturnVO.getData())|| StringUtils.isBlank(stringReturnVO.getData())) {
            return new JSONObject();
        }
        return JSONObject.parseObject(stringReturnVO.getData());
    }
}
